<?php
$this->template->add_css_lib("myscorespresenter.css");
$this->template->add_js_lib("play_game.js");
$this->template->add_js_lib("lights.js");
?>
<div class="breadcrumb breadcrumbs" style="height: 27px;">
    <div class="rdfa-breadcrumb">
        <div xmlns:v="http://rdf.data-vocabulary.org/#">
            <div>
                        <span class="breadcrumbs-title"> </span>
                        <span typeof="v:Breadcrumb"><a rel="v:url" property="v:title" href="http://gamehaynhat.com/" class="home">Home</a></span>
                        <span class="separator">></span>  
                        <span typeof="v:Breadcrumb"><a rel="v:url" property="v:title" href="<?php echo series_url($series->series_code);?>" title="<?php echo $series->series_title;?>"><?php echo $series->series_title;?></a></span></div>
        </div>
    </div>
</div>

	<h1 class="game_title_h1"><?php echo $series->seo_title; ?></h1>
	<p><?php echo $series->seo_description; ?></p><br>
<?php //load_widgets('mid'); ?>
<div class="archive_view">

<div style="min-height: 455px;">
	<div id="intro"> <img src="<?php echo $this->template->url_theme;?>images/logoplay.png" />
		<div id="showprogressbar" style="display:block; margin:0px;">
			<div id="progressbar" style="margin-left: 146px;"> <span id="progresstext">0%</span>
				<div id="progressbarloadbg" style="z-index: 2; transition: width 5s;">&thinsp;</div>
			</div>
		</div>
		<div id="progressbarloadtext" onclick="window.hide();"> Tải game hoàn tất, chơi game ngay! </div>
	</div>
	<div class="clear"></div>
	<div id="my_game" style="height: 100%; width: 100%; display: none;">
		<div id="escenario">
			<div id="play_game">
				<div id="bordeswf">
					<embed id="playgame" src="<?php echo image_src($game->game_file ); ?>" wmode="transparent" menu="false" quality="high" width="670" height="<?php echo ($game->game_file_rate_height_width*670);?>" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"> 
				</div>
			</div>
			  
			<div class="clear"></div>
		</div>
	</div>
</div>
	
</div>



<div class="related">
  <h3 id="tabs_header" class="box-title">Game <?php echo $series->series_title;?> mới nhất</h3>
	<div class="home-sidebar">
    <ul>
	<?php
	  if($games){
	  foreach($games as $game){
	  ?>
    <li class="gamebox_head_wrapper">
		<?php $this->load->view('frontend/box/game', array('game'=> $game)); ?>
	    </li>
	 <?php } 
	 //unset($games);
	 }?>
      
      </ul>
</div>
</div>
<?php if (is_module_active('ultimate_games_module') &&  function_exists('run_widget')) run_widget('ultimate_games_module', array(
				'widget_layout'=> 'playgame',
				'widget_position'=> 'mid',
				'limit'=> 14,
				'title_link'=> '',
				'widget_title'=> 'Game '.$series->series_title.' cùng thể loại',
				'cateid'=> $cate->cat_id,
			)); ?>

<script>
<?php if($msg !='') {
	echo 'alert("'.$msg.'");';
} ?>
</script> 
<script type="text/javascript">
function change_screen_game_player(pid) {
	$("#game_out").click(function() {
		embed = $('#playgame').animate();
		embed_ie = $('#playgame_ie').animate();
		var max_width = 800;
		var ar = embed.width()/embed.height(); 
		var ar_ie = embed_ie.width()/embed_ie.height(); 
		$('#playgame').attr('width', max_width);
		$('#playgame').attr('height', max_width/ar);
		// Xu ly mo rong tren IE
		$('#playgame_ie').attr('width', max_width);
		$('#playgame_ie').attr('height', max_width/ar_ie);
		
		$("#content_game").attr("id", "content_game-full");
		//$('.centerBox-o-c-gamePage-gameplay').attr("class", "centerBox-o-c-gamePage-gameplay-full-1004");
		$('#game_out').hide();
		$('#game_in').show();
	});
	$("#game_in").click(function() {
		//var v_width = $("#hnd_width").val();
		embed = $('#playgame').animate();
		var max_width = 670;
		var ar = embed.width()/embed.height(); 
		var ar_ie = embed_ie.width()/embed_ie.height(); 
		$('#playgame').attr('width', max_width);
		$('#playgame').attr('height', max_width/ar);
		
		// Xu ly thu nho tren IE
		$('#playgame_ie').attr('width', max_width);
		$('#playgame_ie').attr('height', max_width/ar_ie);
		
		$("#content_game-full").attr("id", "content_game");
		//$('.centerBox-o-c-gamePage-gameplay-full-1004').attr("class", "centerBox-o-c-gamePage-gameplay");
		$('#game_out').show();
		$('#game_in').hide();
	});
}
</script>